package cn.melonlib.aap.user.model.entity;

import cn.melonlib.cores.commons.model.anno.MelonEntityId;
import cn.melonlib.cores.commons.model.enums.IdType;
import cn.melonlib.cores.commons.model.enums.IdValueType;
import cn.melonlib.cores.commons.model.support.number_id.MelonLibLongIdEntity;
import cn.melonlib.cores.identification.model.entity.Organization;
import cn.melonlib.cores.model.anno.ModelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;

import javax.persistence.*;

@Data
@EqualsAndHashCode(callSuper = true)
@Entity(name = "School")
@Table(name = "org_school")
@ModelComment("学校信息")
@MelonEntityId(type = IdType.SNOW_FLAKE,IdValueType = IdValueType.LONG)
public class School extends MelonLibLongIdEntity implements Organization {

    @ModelComment("学校编号，一般使用主域名格式")
    private String code;

    @ModelComment("学校名称")
    private String name;

    @ModelComment("联系电子邮箱")
    private String email;

    @ModelComment("学校网站首页")
    private String www;

    @ModelComment("联系电话")
    private String phone;

    @ModelComment("联系人手机")
    private String mobile;

    @ModelComment("联系人姓名")
    private String contacts;

    @ModelComment("学校简介")
    @Column@Lob@Basic(fetch = FetchType.LAZY)
    private String memo;

    @ModelComment("传真地址")
    private String fax;

    @ModelComment("学校地址")
    @Column@Lob@Basic(fetch = FetchType.LAZY)
    @Type(type = "org.hibernate.type.TextType")
    private String address;

    @ModelComment("学校logo")
    @Column@Lob@Basic(fetch = FetchType.LAZY)
    @Type(type = "org.hibernate.type.TextType")
    private String logo;

    @ModelComment("学校验证信息")
    @Column@Lob@Basic(fetch = FetchType.LAZY)
    @Type(type = "org.hibernate.type.TextType")
    private String validationInfo;

    @ModelComment("是否为已认证学校")
    private Boolean validation;

    @ModelComment("是否通过域名访问系统")
    private Boolean domain;
}
